package com.dd.cloud.user.entity.order;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author czg
 * @since 2020-03-21
 */
@Data
@EqualsAndHashCode
@Accessors(chain = true)
@Table(comment = "订单表")
public class OrderPay implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单编号 订单信息表
     */
    @TableId(type = IdType.INPUT)
    @Column(isKey = true, comment = "订单编号")
    private String orderNo;


    /**
     * 处方编号
     */
    @Column(length = 60, comment = "处方编号(先暂时此字段,同步之后删除)")
    private String tencode;

    /**
     * 业务服务编号 如处方编号, 预约id
     */
    @Column(length = 60, comment = "业务服务编号 与product字段相关联 如处方编号, 预约id")
    private String serverNo;

    /**
     * 应付金额，单位分
     */
    @Column(comment = "应付金额(分)")
    private Integer totalFee;

    /**
     * 应付金额，单位分
     */
    @Column(comment = "支付的参数id")
    private Integer payParamId;

    /**
     * 实付金额，单位分
     */
    @Column(comment = "实付金额(分)")
    private Integer actualPay;

    /**
     * 订单状态 1支付成功 其他...
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "订单状态 1未支付 2已支付 3全部退款 4有补款 5有退款 6超时订单作废")
    private Integer status;

    /**
     * 创建时间
     */
    @Column(comment = "创建时间", defaultValue = "now()")
    private LocalDateTime createDate;

    /**
     * 更新时间
     */
    @Column(comment = "更新时间")
    private LocalDateTime updateDate;

    /**
     * 备注
     */
    @Column(length = 100, comment = "备注")
    private String remark;

    /**
     * 备注
     */
    @Column(length = 100, comment = "支付的产品内容 pre处方 single预约咨询问诊")
    private String product;

    /**
     * 结算状态 1冻结中 2待结算 3已结算
     */
    @Column(type = MySqlTypeConstant.TINYINT, comment = "结算状态 1冻结中 2待结算 3已结算", defaultValue = "1")
    private Integer settlement;
}
